using System.Collections.Generic;
using System.Data;
using WS.EKA.Utilities.Helpers;

namespace WS.EKA.Utilities.Extensions
{
    public static class DataExtensions
    {
        public static List<T> ToList<T>(this DataSet dataset)
            where T : new()
        {
            return DataTransferHelper.ToList<T>(dataset, null);
        }

        public static List<T> ToList<T>(this DataSet dataset, string name)
            where T : new()
        {
            return DataTransferHelper.ToList<T>(dataset, name);
        }

        public static List<T> ToList<T>(this DataTable dataTable)
            where T : new()
        {
            return DataTransferHelper.ToList<T>(dataTable);
        }
    }
}
